package org.flower.isme.flower.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.flower.isme.common.response.Page;
import org.flower.isme.flower.domain.dto.SoilDataDto;
import org.flower.isme.flower.domain.entity.SoilData;
import org.flower.isme.flower.domain.request.SoilDataPageRequest;
import org.flower.isme.flower.service.SoilDataService;
import org.flower.isme.flower.mapper.SoilDataMapper;
import org.springframework.stereotype.Service;


@Service
public class SoilDataServiceImpl extends ServiceImpl<SoilDataMapper, SoilData>
    implements SoilDataService{

    /**
     * 分页查询土壤温度列表
     *
     * @param soilDataPageRequest 查询信息
     * @return Page
     */
    @Override
    public Page<SoilDataDto> queryPage(SoilDataPageRequest soilDataPageRequest) {
        IPage<SoilData> page = soilDataPageRequest.toPage();
        IPage<SoilDataDto> convert = baseMapper
                .selectPage(page, null)
                .convert(item -> item.convert(SoilDataDto.class));
        return Page.convert(convert);
    }
}




